home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 34.zip
/
BS1 part 34
/
GFA basic training.adf
/
Copper
/
DUALCOPPER.LST
< prev
next >
Wrap
File List
|
1989-06-01
|
6KB
|
266 lines
' Verwaltung von zwei Copperlisten
'
@copper_init
'
REPEAT
PRINT "Bunt nicht?",
PAUSE 40
EXIT IF MOUSEK
@user_copper1_an
EXIT IF MOUSEK
PRINT "Bunt nicht?",
PAUSE 40
@user_copper2_an
UNTIL MOUSEK
'
@user_copper_aus
EDIT
'
> PROCEDURE copper_init
OPTION BASE 0
DIM mem&(1),u_copadr%(1),neu_copadr%(1)
DIM startcop%(1)
@usercop1_lÄnge
@usercop2_lÄnge
@memory_copperbereit
RETURN
> PROCEDURE datas
copperlist1: ! Das erste Label für die RESTORE-Anweisung
DATA $0180,$0000
DATA $7701,$fffe
DATA $0180,$0f00
DATA $7801,$fffe
DATA $0180,$0f10
DATA $7901,$fffe
DATA $0180,$0f20
DATA $7a01,$fffe
DATA $0180,$0f40
DATA $7b01,$fffe
DATA $0180,$0f60
DATA $7c01,$fffe
DATA $0180,$0f70
DATA $7d01,$fffe
DATA $0180,$0f80
DATA $7e01,$fffe
DATA $0180,$0f90
DATA $7f01,$fffe
DATA $0180,$0fa0
DATA $8001,$fffe
DATA $0180,$0fb0
DATA $8101,$fffe
DATA $0180,$0fc0
DATA $8201,$fffe
DATA $0180,$0fd0
DATA $8301,$fffe
DATA $0180,$0fe0
DATA $8401,$fffe
DATA $0180,$0ff0
DATA $8501,$fffe
DATA $0180,$0ff1
DATA $8601,$fffe
DATA $0180,$0ff2
DATA $8701,$fffe
DATA $0180,$0ff3
DATA $8801,$fffe
DATA $0180,$0ff4
DATA $8901,$fffe
DATA $0180,$0ff5
DATA $8a01,$fffe
DATA $0180,$0ef5
DATA $8b01,$fffe
DATA $0180,$0df5
DATA $8c01,$fffe
DATA $0180,$0cf5
DATA $8d01,$fffe
DATA $0180,$0bf4
DATA $8e01,$fffe
DATA $0180,$0af3
DATA $8f01,$fffe
DATA $0180,$09f2
DATA $9001,$fffe
DATA $0180,$08f1
DATA $9101,$fffe
DATA $0180,$07f2
DATA $9201,$fffe
DATA $0180,$06e3
DATA $9301,$fffe
DATA $0180,$06d3
DATA $9401,$fffe
DATA $0180,$06c3
DATA $9501,$fffe
DATA $0180,$06b3
DATA $9601,$fffe
DATA $0180,$06a3
DATA $9801,$fffe
DATA $0180,$0693
DATA $9901,$fffe
DATA $0180,$0683
DATA $9a01,$fffe
DATA $0180,$0673
DATA $9b01,$fffe
DATA $0180,$0664
DATA $9c01,$fffe
DATA $0180,$0655
DATA $9d01,$fffe
DATA $0180,$0555
DATA $9e01,$fffe
DATA $0180,$0546
DATA $9f01,$fffe
DATA $0180,$0
DATA $ffff
RETURN
> PROCEDURE datas2
copperlist2: ! Das zweite Label für die RESTORE-Anweisung
DATA $0180,$0000
DATA $d701,$fffe
DATA $0180,$0f00
DATA $d801,$fffe
DATA $0180,$0f10
DATA $d901,$fffe
DATA $0180,$0f20
DATA $da01,$fffe
DATA $0180,$0f40
DATA $db01,$fffe
DATA $0180,$0f60
DATA $dc01,$fffe
DATA $0180,$0f70
DATA $dd01,$fffe
DATA $0180,$0f80
DATA $de01,$fffe
DATA $0180,$0f90
DATA $df01,$fffe
DATA $0180,$0fa0
DATA $e001,$fffe
DATA $0180,$0fb0
DATA $e101,$fffe
DATA $0180,$0fc0
DATA $e201,$fffe
DATA $0180,$0fd0
DATA $e301,$fffe
DATA $0180,$0fe0
DATA $e401,$fffe
DATA $0180,$0ff0
DATA $e501,$fffe
DATA $0180,$0ff1
DATA $e601,$fffe
DATA $0180,$0ff2
DATA $e701,$fffe
DATA $0180,$0ff3
DATA $e801,$fffe
DATA $0180,$0ff4
DATA $e901,$fffe
DATA $0180,$0ff5
DATA $ea01,$fffe
DATA $0180,$0ef5
DATA $eb01,$fffe
DATA $0180,$0df5
DATA $ec01,$fffe
DATA $0180,$0cf5
DATA $ed01,$fffe
DATA $0180,$0bf4
DATA $ee01,$fffe
DATA $0180,$0af3
DATA $ef01,$fffe
DATA $0180,$09f2
DATA $f001,$fffe
DATA $0180,$08f1
DATA $f101,$fffe
DATA $0180,$07f2
DATA $f201,$fffe
DATA $0180,$06e3
DATA $f301,$fffe
DATA $0180,$06d3
DATA $f401,$fffe
DATA $0180,$06c3
DATA $f501,$fffe
DATA $0180,$06b3
DATA $f601,$fffe
DATA $0180,$06a3
DATA $f801,$fffe
DATA $0180,$0693
DATA $f901,$fffe
DATA $0180,$0683
DATA $fa01,$fffe
DATA $0180,$0673
DATA $fb01,$fffe
DATA $0180,$0664
DATA $fc01,$fffe
DATA $0180,$0655
DATA $fd01,$fffe
DATA $0180,$0555
DATA $fe01,$fffe
DATA $0180,$0546
DATA $ff01,$fffe
DATA $0180,$0
DATA $ffff
RETURN
> PROCEDURE usercop1_lÄnge
RESTORE copperlist1
DO
READ x%
EXIT IF x%=&HFFFF
INC anz1& ! Anzahl Worte
LOOP
MUL anz1&,2 ! Anzahl Bytes
RETURN
> PROCEDURE usercop2_lÄnge
RESTORE copperlist2
DO
READ x%
EXIT IF x%=&HFFFF
INC anz2& ! Anzahl Worte
LOOP
MUL anz2&,2 ! Anzahl Bytes
RETURN
> PROCEDURE memory_copperbereit
mem&(0)=76+anz1& ! 76 Bytes werden noch vom System übernommen
mem&(1)=76+anz2& ! 76 Bytes werden noch vom System übernommen
altcop%=LPEEK(_GfxBase+50) ! Copper-Automatik-Vector relativ zu GFXBASE retten
startcop%(0)=altcop%+84 ! Anfang der Daten die übernommen werden müssen
startcop%(1)=altcop%+84 ! Anfang der Daten die übernommen werden müssen
FOR i|=0 TO 1
u_copadr%(i|)=MALLOC(mem&(i|),2)! Chipmemory belegen in errechneter Größe
neu_copadr%(i|)=u_copadr%(i|) ! Zweimal speichern (Zaehler und Übergabe)
'
' Startliste des Systems Kopieren
BMOVE startcop%(i|),neu_copadr%(i|),60
ADD neu_copadr%(i|),60 ! 60 sind schon drin, darum um 60 erhöhen
' Unsere Liste
IF i|=0
RESTORE copperlist1
ELSE IF i|=1
RESTORE copperlist2
ENDIF
CLR zeiger&,x%
' Daten schreiben
DO
READ x%
EXIT IF x%=&HFFFF
DPOKE neu_copadr%(i|)+zeiger&,x%
ADD zeiger&,2
LOOP
' End Liste des Systems kopieren
ADD startcop%(i|),60
IF i|=0
ADD neu_copadr%(i|),anz1&
ELSE IF i|=1
ADD neu_copadr%(i|),anz2&
ENDIF
BMOVE startcop%(i|),neu_copadr%(i|),16
NEXT i|
RETURN
> PROCEDURE user_copper1_an
VSYNC ! Warten auf Vblank, damit Copper nicht ausliest
LONG{_GfxBase+50}=u_copadr%(0)! (Unsere) Adresse in den Auto-Vector schreiben
RETURN
> PROCEDURE user_copper2_an
VSYNC ! Warten auf Vblank, damit Copper nicht ausliest
LONG{_GfxBase+50}=u_copadr%(1)! (Unsere) Adresse in den Auto-Vector schreiben
RETURN
> PROCEDURE user_copper_aus
VSYNC ! Warten, damit Copper nicht stört
LONG{_GfxBase+50}=altcop% ! Vector zurückschreiben (System-Datenliste)
~MFREE(u_copadr%(0),mem1&) ! 1.User-Coplistspeicher Frei!
~MFREE(u_copadr%(1),mem2&) ! 2.User-Coplistspeicher Frei!
RETURN